import request from '@/utils/request'
import qs from 'qs'
export function insertModel(data) {
  return request({
    url: '/api/cmStatementAudit/insertConfigModel',
    method: 'post',
    data:data
  })
}

export function selectParam(data) {
    return request({
        url: '/api/cmStatementAudit/selectImpalaParam',
        method: 'get',
    })
}

export function editConfig(data) {
  return request({
      url: '/api/cmStatementAudit/updateConfigModel',
      method: 'post',
      data:data
  })
}

export function anomalyModel(data) {
  return request({
      url: '/api/cmStatementAudit/selectParam',
      method: 'post',
      data:data
  })
}

// 获取中心集群信息
export function selAllCm(data) {
  return request({
    url: '/monitor_api/monitor/selAllCm',
    method: 'post',
    data: data
  })
}

export function selAllCluster(data) {
  return request({
    url: '/monitor_api/monitor/selAllCluster',
    method: 'post',
    data: data
  })
}

export function getModel(data) {
  return request({
      url: '/api/cmStatementAudit/findConfigModel?componentType='+data,
      method: 'get',
  })
}

export function getCluster() {
  return request({
      url: '/api/cmStatementAudit/selectClusterName',
      method: 'get',
  })
}

export function getAlarm(data) {
  return request({
      url: '/api/cmStatementAudit/selectAuditAlarm',
      method: 'post',
      data:data
  })
}

export function getModelName(data) {
  return request({
      url: '/api/cmStatementAudit/selectModelNameByCluster',
      method: 'post',
      data:data
  })
}

export function getModelMap(data) {
  return request({
      url: '/api/cmStatementAudit/selectModelSummary',
      method: 'post',
      data:data
  })
}

export function delModel(data) {
  return request({
      url: '/api/cmStatementAudit/deleteConfigModel',
      method: 'post',
      data:data
  })
}

export function impalaProfile(data) {
  return request({
      url: '/api/cmStatementAudit/getImpalaProfileById',
      method: 'post',
      data:data
  })
}

export function impalaConcurrency(data) {
  return request({
      url: '/api/cmStatementAudit/selectImpalaConcurrency',
      method: 'post',
      data:data
  })
}

export function mapreduceConcurrency(data) {
  return request({
      url: '/api/cmStatementAudit/selectMapreduceConcurrency',
      method: 'post',
      data:data
  })
}

export function rangerInfo() {
  return request({
      url: '/api/cmStatementAudit/selectRangerInfo',
      method: 'get',
  })
}

export function downLoad(data) {
  return request({
      url: '/api/cmStatementAudit/exportExcel',
      method: 'post',
      data:data
  })
}
export default {insertModel,selectParam,editConfig,anomalyModel,selAllCm,selAllCluster,getModel,getCluster,getAlarm,getModelName,getModelMap,delModel,impalaProfile,impalaConcurrency,mapreduceConcurrency,rangerInfo,downLoad}
